<template>
  <view class="container">
    <view class="header">
      <text class="header-title">用户列表</text>
    </view>
    <view class="user-list">
      <view class="user-item" v-for="user in users" :key="user.id">
        <image :src="user.avatar" class="user-avatar"></image>
        <view class="user-info">
          <text class="user-name">{{ user.name }}</text>
          <text class="user-email">{{ user.email }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      users: [
        {
          id: 1,
          name: '张三',
          email: 'zhangsan@example.com',
          avatar: 'https://randomuser.me/api/portraits/men/1.jpg'
        },
        {
          id: 2,
          name: '李四',
          email: 'lisi@example.com',
          avatar: 'https://randomuser.me/api/portraits/men/2.jpg'
        },
        {
          id: 3,
          name: '王五',
          email: 'wangwu@example.com',
          avatar: 'https://randomuser.me/api/portraits/men/3.jpg'
        }
      ]
    };
  }
};
</script>

<style>
.container {
  padding: 20px;
  background-color: #f5f5f5;
  height: 100%;
}

.header {
  background-color: #007AFF;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.header-title {
  color: white;
  font-size: 20px;
  text-align: center;
}

.user-list {
  display: flex;
  flex-direction: column;
}

.user-item {
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  margin-right: 15px;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 16px;
  font-weight: bold;
}

.user-email {
  font-size: 14px;
  color: #666;
}
</style>
